package com.yangtao.prototype.master.constant.web;

import com.yangtao.framework.util.Struts2Utils;
import com.yangtao.framework.web.struts2.BaseAction;
import com.yangtao.prototype.master.constant.service.ConstantService;

public class ConstantAction extends BaseAction<ConstantModel, ConstantService> {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public String init() {
		service.getAllList(model);
		return render("ConstantQuery");
	}

	public String selectByType() {
		model = service.getList(model);
		Struts2Utils.renderJson(model.getPage());
		return null;
	}

	public String save() {
		service.saveConstant(model);
		return renderJsonMessage();
	}

	public String findConst() {
		service.findConst(model);
		Struts2Utils.renderJson(model.getPage());
		return null;
	}
}
